package com.selfdriving.wl.activity;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;

import com.selfdriving.BaseApplication;
import com.selfdriving.R;
import com.selfdriving.adapter.FeatureListAdapter;
import com.selfdriving.bean.Feature;

public class BestFeatureSoaring {
	/** 当前View **/
	View view;
	BaseApplication application;
	Context context;

	private ListView feature_list;

	private Button btnLeft;

	private Button btnRight;

	private FeatureListAdapter adapter;

	private List<Feature> features;

	private OnClickListener onClickListener;

	public BestFeatureSoaring(BaseApplication application, Context context,
			OnClickListener onClickListener, List<Feature> features) {
		LayoutInflater inflater = LayoutInflater.from(context);
		view = inflater.inflate(R.layout.w_pager_soaring_list, null);
		this.application = application;
		this.context = context;
		this.onClickListener = onClickListener;
		this.features = features;
		initViews();
	}

	public void initViews() {
		feature_list = (ListView) view.findViewById(R.id.feature_list);

		btnLeft = (Button) view.findViewById(R.id.ivLeft);

		btnRight = (Button) view.findViewById(R.id.ivRight);

		btnLeft.setOnClickListener(onClickListener);

		btnRight.setOnClickListener(onClickListener);

		adapter = new FeatureListAdapter(context, features);

		feature_list.setAdapter(adapter);
	}

	public View getView() {
		return view;
	}

}
